home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / scrollkeeper-get-index-from-docpath < prev    next >
Encoding:
Text File  |  2007-03-09  |  642 b   |  41 lines

  1. #! /bin/sh
  2.  
  3. prefix=/usr
  4. BIN=${prefix}/bin
  5. localstatedir=/var
  6.  
  7. usage()
  8. {
  9.     cat <<EOF
  10. Usage: scrollkeeper-get-index-from-docpath <DOCPATH> 
  11. EOF
  12.  
  13.     exit $1
  14. }
  15.  
  16. if test $# -eq 0; then
  17.     usage 1
  18. fi
  19.  
  20. scrollkeeper_dir=`scrollkeeper-config --pkglocalstatedir`
  21.  
  22. docids=`grep $1 ${scrollkeeper_dir}/scrollkeeper_docs | \
  23.           awk 'BEGIN { FS="    "} {print $2}'`
  24.       
  25. for docid in $docids; do
  26.     break;
  27. done
  28.  
  29. if test -z $docid; then
  30.     echo $1 is not installed
  31.     exit 1 
  32. fi
  33.  
  34. if test -f ${scrollkeeper_dir}/index/$docid; then
  35.     echo ${scrollkeeper_dir}/index/$docid
  36.     exit 0
  37. else
  38.     echo No index available for this path!!!
  39.     exit 1
  40. fi
  41.